/*
 * **.cpp - 
 *
 * Copyright (C) 2010-2012 Serge Begger
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef CUEPARSER_H
#define CUEPARSER_H

#include <QObject>
#include <QFile>
#include <QFileInfo>
#include <QTextStream>
#include <QStringList>

struct track{
    QString Album;
    QString Artist;
    QString Title;
    qint64 Start;
    qint64 Lenght;
    int Year;
};

class cueparser : public QObject
{
    Q_OBJECT
public:
    explicit cueparser(QObject *parent = 0);
    bool parse(QString filename);
    QList<track> trackList;
    void frame_to_msf(qint64 frame, int *m, int *s, int *f);

signals:

public slots:

private:
    qint64 getFrame(QString msf);
    qint64 msf_to_frame(int m, int s, int f);
    QStringList splitLine(const QString &line);
};

#endif // CUEPARSER_H
